==
<?
function onStart()
{
    $this['backendUrl'] = System::checkDebugMode() ? Backend::url('/') : null;
}
?>
==
<!-- Nav -->
<nav id="layout-nav" class="navbar navbar-inverse navbar-fixed-top navbar-autohide" role="navigation">
    <div class="container">
        <div class="row">
            <div class="col-md-10 col-md-offset-1">
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-main-collapse">
                        <span class="sr-only">Toggle navigation</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                    <a class="navbar-brand" href="{{ 'home'|page }}">October CMS Demo</a>
                </div>
                <div class="collapse navbar-collapse navbar-main-collapse">
                    <ul class="nav navbar-nav">
                        <li class="{% if this.page.id == 'home' %}active{% endif %}"><a href="{{ 'home'|page }}">Basic Concepts</a></li>
                        <li class="{% if this.page.id == 'ajax' %}active{% endif %}"><a href="{{ 'ajax'|page }}">AJAX Framework</a></li>
                        <li class="{% if this.page.id == 'plugins' %}active{% endif %}"><a href="{{ 'plugins'|page }}">CMS Components</a></li>
                        {% if backendUrl %}
                            <li><a href="{{ backendUrl }}" target="backend">Backend Area</a></li>
                        {% endif %}
                    </ul>
                </div>
            </div>
        </div>
    </div>
</nav>
